package com.breaktian.demoapp.ui.jetpack;

import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProvider;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.breaktian.assemble.livedatabus.LiveDataBus;
import com.breaktian.demoapp.R;
import com.breaktian.demoapp.ui.base.Base2Activity;
import com.breaktian.demoapp.ui.jetpack.viewmodel.TestViewModel;

public class JetPack2Activity extends Base2Activity<TestViewModel> {

    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jet_pack2);
        textView = (TextView)findViewById(R.id.textView);
        LiveDataBus.getDefault().channel("test", String.class).subscribeSticky(this, new Observer<String>() {
            @Override
            public void onChanged(@Nullable String s) {
                textView.setText(s);
            }
        });


        LiveDataBus.getDefault().channel("test").sendDelay("9999999",5000);






    }

    @Override
    protected TestViewModel getViewModel() {
        return null;
    }

}
